In this paper, we evaluate the PERFORMANCE of two machine learning architectures— Recurrent Neural Networks (RNN) and Transformer-based models—on four commodity-based company indices from the Tehran Stock Exchange. The Transformer-based models used in this study include AutoFormer, FEDformer, Informer, and PatchTST, while the RNN-based models consist of GRU and LSTM. The dataset comprises daily observations collected from April 20, 2020, to November 20, 2024. To enhance the generalization power of the models and prevent overfitting, we employ two techniques: splitting the training and test samples, and applying regularization methods such as dropout. Hyperparameters for all models were selected using a visual method. Our results indicate that the PatchTST model outperforms other methods in terms of Root Mean Squared Error (RMSE) for both 1-day and 5-day (1-week) FORECASTING horizons. The FEDformer model also demonstrates promising PERFORMANCE, particularly for FORECASTING the MetalOre time series. In contrast, the AutoFormer model performs relatively poorly for longer FORECASTING horizons, while the GRU and LSTM models yield mixed results. These findings underscore the significant impact of model selection and FORECASTING horizon on the accuracy of time series forecasts, emphasizing the importance of careful model choice and hyperparameter tuning for achieving optimal PERFORMANCE.